Image processing device, image reading apparatus and non-transitory computer readable medium storing program

ABSTRACT

An image processing device includes: an obtaining unit that obtains image information of a second region to detect an erecting direction of an image formed on a document, the second region being defined in the image in advance according to a criterion different from a criterion for defining a first region in the image, in which character recognition is performed; and an output unit that outputs character information of the first region, the character information being recognized in accordance with the erecting direction of the image obtained from the image information.

CROSS REFERENCE TO RELATED APPLICATION

This application is based on and claims priority under 35 USC § 119 fromJapanese Patent Application No. 2016-030566 filed Feb. 22, 2016.

BACKGROUND

Technical Field

The present invention relates to an image processing device, an imagereading apparatus and a non-transitory computer readable medium storinga program.

Related Art

In recent years, techniques for determining a direction of a document,and if the direction cannot be determined, applying another process ofdetermining the direction have been suggested.

SUMMARY

According to an aspect of the present invention, there is provided animage processing device including: an obtaining unit that obtains imageinformation of a second region to detect an erecting direction of animage formed on a document, the second region being defined in the imagein advance according to a criterion different from a criterion fordefining a first region in the image, in which character recognition isperformed; and an output unit that outputs character information of thefirst region, the character information being recognized in accordancewith the erecting direction of the image obtained from the imageinformation.

BRIEF DESCRIPTION OF THE DRAWINGS

An exemplary embodiment of the present invention will be described indetail based on the following figures, wherein:

FIG. 1 is a diagram showing a hardware configuration example of an imageprocessing device according to an exemplary embodiment;

FIG. 2 is a block diagram showing a functional configuration example ofthe image processing device according to the exemplary embodiment;

FIGS. 3A to 3D are diagrams for illustrating examples of an erectingdirection determination process;

FIGS. 4A to 4E are diagrams showing examples of erecting designationregions identified by an erecting designation region identificationsection;

FIGS. 5A to 5E are diagrams showing examples of erecting designationregions identified by the erecting designation region identificationsection;

FIGS. 6A and 6B are diagrams showing examples of erecting designationregions identified by the erecting designation region identificationsection;

FIGS. 7A to 7D are diagrams showing examples of erecting designationregions identified by an erecting designation region identificationsection;

FIGS. 8A and 8B are diagrams for illustrating examples of a process oferecting direction determination and character recognition; and

FIG. 9 is a flowchart showing an example of procedures performing theprocess of erecting direction determination and character recognition bythe image processing device.

DETAILED DESCRIPTION

Hereinafter, an exemplary embodiment according to the present inventionwill be described in detail with reference to attached drawings.

<Hardware Configuration of Image Processing Device>

First, a hardware configuration of an image processing device 10according to the exemplary embodiment will be described. FIG. 1 is adiagram showing the hardware configuration example of the imageprocessing device 10 according to the exemplary embodiment. The imageprocessing device 10 according to the exemplary embodiment is anapparatus called a multifunction machine that includes, for example, ascanning function, a printing function, a copying function, a facsimilefunction and the like. As shown in FIG. 1, the image processing device10 includes: a CPU (Central Processing Unit) 101; a ROM (Read OnlyMemory) 102; a RAM (Random Access Memory) 103; an operation section 104;a display 105; an image reader 106; an image forming section 107; animage processor 108; a communication section 109; and a memory 110. Notethat the respective functional sections are connected to a bus 111, andperforms data transmission and reception via the bus 111.

The CPU 101 executes various kinds of programs, such as an OS (OperatingSystem) or application. Moreover, the ROM 102 is a memory that stores acontrol program executed by the CPU 101. The RAM 103 is a memory used asa working memory or the like for the CPU 101. Then, the CPU 101 readsthe control program stored in the ROM 102 and executes the controlprogram using the RAM 103 as a work area. When the control program isexecuted by the CPU 101, each function in the image processing device 10is implemented.

The operation section 104 accepts operations by a user. The operationsection 104 is configured with, for example, hardware keys. Moreover,the operation section 104 is configured with, for example, a touch panelthat outputs a control signal in response to a contact position. As ameasure for detecting the contact, anything, such as a measure fordetecting based on a pressure caused by the contact, or a measure fordetecting based on static electricity of a contact item, may be used.

The display 105 is configured with, for example, a liquid crystaldisplay, and displays data related to the image processing device 10.For example, the display 105 displays a screen referenced by a user whenthe user operates the image processing device 10.

The image reader 106 reads an image formed on a document that is set bya user or the like, and generates image data indicating the read image.Here, the image reader 106 is, for example, a scanner, in which a CCDsystem that reduces reflected light of light emitted to a document froma light source by a lens and receives the reduced reflected light by aCCD (Charge Coupled Devices), a CIS system that receives reflected lightof light sequentially emitted to a document from an LED light source bya CIS (Contact Image Sensor), or the like is employed.

The image forming section 107 includes a print mechanism that forms animage on a recording medium, such as a sheet. Here, the image formingsection 107 is, for example, a printer, and a printer of anelectrophotographic system that forms an image by transferring tonerattached to a photoreceptor onto a recording medium or a printer of anink jet system that forms an image by ejecting ink onto a sheet may beused.

The image processing section 108 applies image processing, such as colorcorrection or tone correction, to an image represented by image data.

The communication section 109 is connected to a not-shown communicationline and functions as a communication interface that performscommunication with other devices connected to the communication line.For example, via the communication section 109, transmission andreception of image data with other devices are performed.

The memory 110 includes a storage region, such as a hard disk device,and stores, for example, data received by the communication section 109or data created by the image processing device 10.

Then, though details will be described later, the image processingdevice 10 according to the exemplary embodiment makes determination ofan erecting direction of image data generated by reading an image formedon a document, to thereby recognize characters included in the imagedata. Here, the erecting direction refers to a direction in which thecharacters in the image are correctly readable. Moreover, fordetermination of the erecting direction or character recognition, forexample, an OCR is used. The OCR is a technique for analyzing characterson image data and converting thereof into character data handled by acomputer.

<Functional Configuration of Image Processing Device>

Next, a functional configuration of the image processing device 10according to the exemplary embodiment will be described. FIG. 2 is ablock diagram showing a functional configuration example of the imageprocessing device 10 according to the exemplary embodiment. The imageprocessing device 10 includes: an image data obtaining section 11; anerecting designation information obtaining section 12; an erectingdesignation region identification section 13; an erecting directiondetermination section 14; an OCR designation information obtainingsection 15; an OCR designation region identification section 16; and anOCR execution section 17.

The image data obtaining section 11 obtains image data which the imagereader 106 generated by reading an image formed on a document. The imagedata is a target of erecting direction determination and characterrecognition, and is referred to as target image data, hereinafter.

The erecting designation information obtaining section 12, as an exampleof an positional information obtaining unit, obtains information fordetermining a position (hereinafter, referred to as an erectingdesignation information) of a region defined in advance as a region forperforming erecting direction determination (detection) (hereinafter,referred to as an erecting designation region) in target image data. Theerecting designation information is information representing a positionof target image data in an image, such as, coordinate information. Theerecting designation information is, for example, set in advance foreach type of a document, and determined by input of the type of thedocument set in the image processing device 10 by a user. Moreover, forexample, a user may confirm the content of the document and input theerecting designation information. Note that, in the exemplaryembodiment, the erecting designation region is used as an example of asecond region defined in advance for detecting the erecting direction ofan image. Moreover, as an example of the positional information, theerecting designation information is used.

The erecting designation region identification section 13 identifies aposition of an erecting designation region in target image data based onerecting designation information obtained by the erecting designationinformation obtaining section 12. Here, though details will be describedlater, the erecting designation region identification section 13identifies the position of the erecting designation region in each ofplural directions (for example, four directions) of the target imagedata based on the erecting designation information.

The erecting direction determination section 14, as an example of anobtaining unit and a determination unit, determines an erectingdirection of the target image data (that is, the erecting direction ofthe document) based on the image information of the erecting designationregion identified by the erecting designation region identificationsection 13. Here, the erecting direction determination section 14recognizes the characters included in the erecting designation region byexecuting the OCR process on the erecting designation region, to therebydetermine the erecting direction of the target image data. Morespecifically, for example, the erecting direction determination section14 reads the characters included in the erecting designation region fromthe plural directions, and identifies the characters by checking thecharacters against predefined dictionary character patterns. Byidentifying the characters in the erecting designation region in thismanner, the erecting direction of the target image data is determined.In other words, the erecting direction of the target image data can begrasped as a direction corresponding to a predefined dictionarycharacter pattern.

FIGS. 3A to 3D are diagrams for illustrating an example of the erectingdirection determination process. The examples shown in the figures showtarget image data 1A in which characters “Amount: 8080 yen” is describedon a document and a region 2A including the characters “Amount: 8080yen” is the erecting designation region. In this case, regarding thetarget image data as shown in FIG. 3A, since the characters in the imagecan be read correctly, the erecting direction determination section 14determines that the direction of 0 degrees is the erecting direction.More specifically, the direction of 0 degrees is a direction in which along side composed of apexes a1 and a2 in the target image data 1A facesupward in the figure.

Moreover, regarding the target image data 1A as shown in FIGS. 3B, 3Cand 3D, the erecting direction determination section 14 determines thatthe directions of 90 degrees, 180 degrees and 270 degrees are theerecting directions, respectively. More specifically, the direction of90 degrees is a direction rotating 90 degrees the direction of 0 degreesin the clockwise direction, in which the long side composed of theapexes a1 and a2 in the target image data 1A faces toward a right sidein the figure. In a similar manner, the direction of 180 degrees is adirection rotating 180 degrees the direction of 0 degrees in theclockwise direction, in which the long side composed of the apexes a1and a2 in the target image data 1A faces downward in the figure.Moreover, the direction of 270 degrees is a direction rotating 270degrees the direction of 0 degrees in the clockwise direction, in whichthe long side composed of the apexes a1 and a2 in the target image data1A faces toward a left side in the figure.

The OCR designation information obtaining section 15 obtains informationfor determining a position (hereinafter, referred to as OCR designationinformation) of a region defined in advance as a region for performingcharacter recognition (hereinafter, referred to as an OCR designationregion) in the target image data. The OCR designation information is,similar to the erecting designation information, informationrepresenting a position of the target image data in an image, such as,coordinate information. The OCR designation information is, for example,set in advance for each type of a document, and determined by input ofthe type of the document set in the image processing device 10 by auser. Moreover, for example, a user may confirm the content of thedocument and input the OCR designation information. Note that, in theexemplary embodiment, the OCR designation region is used as an exampleof a first region in which character recognition is performed.

The OCR designation region identification section 16 identifies aposition of an OCR designation region in the target image data based onthe OCR designation information obtained by the OCR designationinformation obtaining section 15. Here, the OCR designation regionidentification section 16 identifies the position of the OCR designationregion in accordance with the erecting direction of the target imagedata determined by the erecting direction determination section 14.

The OCR execution section 17, as an example of an output unit,recognizes the characters included in the OCR designation region(character information) by executing the OCR process on the OCRdesignation region identified by the OCR designation regionidentification section 16. Here, the OCR execution section 17 recognizesthe characters included in the OCR designation region by executing theOCR process in accordance with the erecting direction of the targetimage data determined by the erecting direction determination section14. More specifically, the OCR execution section 17 recognizes thecharacters in the OCR designation region based on the erecting directionof the target image data, to thereby identify the recognized charactersby checking the characters against the predefined dictionary characterpatterns.

Note that each functional section constituting the image processingdevice 10 shown in FIG. 2 is implemented by cooperation of software andhardware resources. Specifically, the CPU 101 reads the programs forimplementing the image data obtaining section 11, the erectingdesignation information obtaining section 12, the erecting designationregion identification section 13, the erecting direction determinationsection 14, the OCR designation information obtaining section 15, theOCR designation region identification section 16, the OCR executionsection 17 and the like, for example, from the ROM 102 into the RAM 103and executes thereof, and accordingly, these functional sections areimplemented.

<Process of Identifying Position of Erecting Designation Region>

Next, detailed description will be given of a process in which theerecting designation region identification section 13 identifies theposition of the erecting designation region. FIGS. 4A to 4E, FIGS. 5A to5E, FIGS. 6A and 6B, and FIGS. 7A to 7D are diagrams showing examples ofthe erecting designation regions identified by the erecting designationregion identification section 13.

First, in the specific examples shown in FIGS. 4A to 4E, it is assumedthat erecting designation information stipulates that a rectangleconstituted by four points of coordinates (x1, y1), (x2, y2), (x3, y3)and (x4, y4) is regarded as an erecting designation region. Here, forexample, as shown in FIG. 4A, by assuming an apex a1 on the top left inthe figure of the target image data 1A as an origin point O and definingthe X axis in the right direction in the figure and the Y axis in thedownward direction in the figure, the region 2A is identified as anerecting designation region.

On the other hand, for example, if the document is set in a state ofbeing rotated 90 degrees in the clockwise direction from the state shownin FIG. 4A, the position of the erecting designation region to beidentified is changed. More specifically, as shown in FIG. 4B, byassuming an apex a4 on the top left in the figure of the target imagedata 1A as the origin point O and defining the X axis in the rightdirection in the figure and the Y axis in the downward direction in thefigure, the region 2B is identified as the erecting designation region.

Similarly, if the document is set in a state of being rotated 180degrees in the clockwise direction from the state shown in FIG. 4A, asshown in FIG. 4C, an apex a3 on the top left in the figure of the targetimage data 1A is assumed to be the origin point O, and the region 2C isidentified as the erecting designation region. Moreover, if the documentis set in a state of being rotated 270 degrees in the clockwisedirection from the state shown in FIG. 4A, as shown in FIG. 4D, an apexa2 on the top left in the figure of the target image data 1A is assumedto be the origin point O, and the region 2D is identified as theerecting designation region.

In this manner, the position to be identified by the erectingdesignation information is changed in accordance with the direction ofthe document set by the user in some cases. Therefore, the erectingdesignation region identification section 13 identifies the position ofthe erecting designation region from four directions (directions of 0degrees, 90 degrees, 180 degrees and 270 degrees) against the targetimage data based on the erecting designation information. In thespecific examples shown in the figures, as shown in FIG. 4E, theerecting designation region identification section 13 identifies theregions 2A, 2B, 2C and 2D as the erecting designation regions.

Next, examples shown in FIGS. 5A to 5E and FIGS. 6A and 6B show thecases in which identified regions overlap each other as a result ofidentification of the erecting designation regions from the fourdirections against the target image data by the erecting designationregion identification section 13. Note that, in the specific examplesshown in FIGS. 5A to 5E and FIGS. 6A and 6B, similar to the examplesshown in FIGS. 4A to 4E, it is assumed that the erecting designationinformation stipulates that the rectangle constituted by the four pointsof coordinates (x1, y1), (x2, y2), (x3, y3) and (x4, y4) is regarded asthe erecting designation region.

In this case, as shown in FIG. 5A, for example, if the apex a1 of thetarget image data 1A is assumed as the origin point O, the region 2A isidentified as the erecting designation region. On the other hand, if thedocument is set in a state of being rotated 90 degrees in the clockwisedirection from the state shown in FIG. 5A, as shown in FIG. 5B, the apexa4 is assumed as the origin point O, and the region 2B is identified asthe erecting designation region. In a similar manner, if the apex a3 ofthe target image data 1A is assumed as the origin point O in accordancewith the direction of setting of the document, as shown in FIG. 5C, theregion 2C is identified as the erecting designation region. Moreover, ifthe apex a2 of the target image data 1A is assumed as the origin pointO, as shown in FIG. 5D, the region 2D is identified as the erectingdesignation region.

As a result, in the specific examples shown in the figures, as shown inFIG. 5E, the regions 2A and 2C overlap. In this manner, when the regionsidentified as the erecting designation regions overlap each other, theerecting designation region identification section 13 merges theoverlapping regions and assumes thereof as an erecting designationregion. Consequently, the erecting designation region identificationsection 13 identifies the regions 2A (or 2C), 2B, and 2D as the erectingdesignation regions.

Here, it can also be considered that conditions about whether or not themerge is conducted when the regions overlap each other are defined inadvance, and the merge is conducted when the conditions are satisfied.For instance, in the specific example shown in FIG. 5E, parts of theregions 2A and 2B overlap each other. Here, for example, since ratio ofthe overlapping regions to the region 2A as a whole (or the region 2B asa whole) is small, it is assumed that the conditions for conducting themerge of the regions 2A and 2B are not satisfied; then, the erectingdesignation region identification section 13 identifies each of theregions 2A and 2B as the erecting designation region without mergingthereof. On the other hand, in the specific example shown in FIG. 6A,for instance, since ratio of the overlapping regions to the region 2A asa whole (or the region 2C as a whole) exceeds a threshold value, it isassumed that the conditions for conducting the merge of the regions 2Aand 2C are satisfied; then, the erecting designation regionidentification section 13 identifies a region 2E in a rectangular shape(the region represented by oblique lines in FIG. 6A) including both ofthe regions 2A and 2C as the erecting designation region.

Further, in the specific examples shown in FIGS. 5E and 6A, it isassumed that the erecting designation region after merging has arectangular shape; however, the shape of the erecting designation regionafter merging is not limited to the rectangular shape. For example, theerecting designation region identification section 13 may identify aregion 2F (the region represented by oblique lines in FIG. 6B) obtainedby summing the regions 2A (or 2C), 2B and 2D as the erecting designationregion after merging.

Next, examples shown in FIGS. 7A to 7D show the cases in whichidentified regions extend off the target image data as a result ofidentification of the erecting designation regions from the fourdirections against the target image data by the erecting designationregion identification section 13. Note that, in the specific examplesshown in FIGS. 7A to 7D, similar to the examples shown in FIGS. 4A to4E, it is assumed that the erecting designation information stipulatesthat the rectangle constituted by the four points of coordinates (x1, y(x2, y2), (x3, y3) and (x4, y4) is regarded as the erecting designationregion.

In this case, as shown in FIG. 7A, for example, if the apex a1 of thetarget image data 1A is assumed as the origin point O, the region 2A isidentified as the erecting designation region. On the other hand, if thedocument is set in a state of being rotated 90 degrees in the clockwisedirection from the state shown in FIG. 7A, as shown in FIG. 7B, the apexa4 is assumed as the origin point O, and the region 2B is identified asthe erecting designation region. In a similar manner, if the apex a3 ofthe target image data 1A is assumed as the origin point O in accordancewith the direction of setting of the document, as shown in FIG. 7C, theregion 2C is identified as the erecting designation region. Moreover, ifthe apex a2 of the target image data 1A is assumed as the origin pointO, as shown in FIG. 7D, the region 2D is identified as the erectingdesignation region.

As a result, as shown in FIGS. 7B and 7D, the regions 2B and 2D extendoff the target image data 1A. Like this, when the region identified asthe erecting designation region extends off the target image data 1A,the erecting designation region identification section 13 excludes theextending-off region from the erecting designation region, and regardsthe region that is left without being excluded as the erectingdesignation region. Consequently, in the specific examples shown inFIGS. 7A to 7D, the erecting designation region identification section13 excludes the regions 2B and 2D that have extended off the targetimage data 1A from the erecting designation region. Then, the erectingdesignation region identification section 13 identifies the regions 2Aand 2C that are left without being excluded as the erecting designationregions.

<Specific Examples of Process of Erecting Direction Determination andCharacter Recognition>

Next, a process of erecting direction determination and characterrecognition will be described with reference to specific examples. FIGS.8A and 8B are diagrams for illustrating examples of a process oferecting direction determination and character recognition. Here, anorthogonal coordinate system is considered in the target image data 1Ashown in FIGS. 8A and 8B, in which the X axis and the Y axis are definedin the right direction and in the downward direction in the figure,respectively, and a coordinate in the lateral direction and a coordinatein the longitudinal direction in the target image data 1A are defined asthe x-coordinate and the y-coordinate, respectively.

First, in the specific example shown in FIG. 8A, the characters “Amount:8080 yen” are described on a document of the target image data 1A, andthe region 2A including the characters “Amount: 8080 yen” is theerecting designation region. Here, the erecting designation regionidentification section 13 identifies the position of the region 2A asthe erecting designation region in the target image data 1A based on theerecting designation information. Then, the erecting directiondetermination section 14 recognizes the characters “Amount: 8080 yen”included in the region 2A by executing the OCR process, to therebydetermine the erecting direction of the target image data 1A.

More specifically, for example, the erecting direction determinationsection 14 reads the characters included in the region 2A one by onefrom four directions of 0 degrees, 90 degrees, 180 degrees and 270degrees, and checks the characters against predefined dictionarycharacter patterns. Then, the erecting direction determination section14 identifies those having the closest characteristics in the dictionarycharacter patterns in each of the four directions. On that occasion, theerecting direction determination section 14 also calculates a confidencefactor indicating a degree of closeness in characteristics. Then, theerecting direction determination section 14 regards the characterpattern having the highest confidence factor among the confidencefactors calculated as to the four directions as a character recognitionresult, and determines the direction thereof as the erecting direction.

For example, assuming that attention is paid to “A” in “Amount: 8080yen”, the erecting direction determination section 14 cuts a rectangleenclosing the character “A”, and performs character recognition thereonfrom the four directions. In the case of the character “A”, in thepredefined dictionary character patterns, the character pattern havingthe closest characteristics is “A”. Then, the direction thereof is thedirection of 0 degrees (the direction in which a long side composed ofapexes a1 and a2 in the target image data 1A faces upward in thefigure). Therefore, the erecting direction determination section 14determines that the direction of 0 degrees is the erecting direction ofthe target image data 1A.

Similarly, the erecting direction determination section 14 reads each ofthe other characters included in the region 2A from the four directionsto make a determination about the erecting direction. Then, for example,as a result of determining the erecting direction regarding each of thecharacters in the region 2A, the erecting direction determinationsection 14 determines the direction having the highest frequency indetermination as the erecting direction of the target image data 1A.

Note that, only the region 2A is shown as the erecting designationregion in the specific example shown in FIG. 8A; however, as shown inFIGS. 4A to 4E, FIGS. 5A to 5E, FIGS. 6A and 6B, and FIGS. 7A to 7D, theerecting designation region is identified as to the target image data 1Ain the four directions. Then, the erecting direction determinationsection 14 similarly determines the erecting direction as to theerecting designation regions other than the region 2A. Finally, forexample, as a result of determining the erecting direction regardingeach of the erecting designation regions, the erecting directiondetermination section 14 determines the direction having the highestfrequency in determination as the erecting direction of the target imagedata 1A. In the specific example shown in FIG. 8A, the direction of 0degrees is outputted as the erecting direction of the target image data1A.

Here, among the characters “Amount: 8080 yen”, for example, thecharacter “8” or “0” has a possibility of being recognized as “8” or “0”even though the characters are flipped vertically. In other words, “8”and “0” have a possibility of being recognized as characters of highconfidence factor in both cases of performing character recognition fromthe direction of 0 degrees and performing character recognition from thedirection of 180 degrees. Therefore, for example, if the erectingdirection is determined based on “8080” constituted only by thecharacters “8” and “0”, it can be considered that the erecting directionbecomes indeterminable, or the erecting direction is incorrectlyrecognized.

On the other hand, for example, the character “A (in Amount)” or “y (inyen)” is not correctly read when being flipped vertically or rotated 90degrees in the right direction or the left direction. In other words, itcan be said that the character “A” or “y” is a character that causesrecognition difficulty when the target image data 1A is rotated from theerecting direction. If the erecting direction is determined based onsuch a character, there is a high possibility that the erectingdirection of the target image data 1A is correctly determined.

In this way, determination accuracy of the erecting direction isaffected by complexity, shape or the like of the characters to bedetermined. Therefore, in the exemplary embodiment, the position of theerecting designation region is defined so that a character for uniquelydetermining the erecting direction of the target image data, in otherwords, a character that causes recognition difficulty when the targetimage data is rotated from the erecting direction is included in theerecting designation region based on the erecting designationinformation. On the other hand, the position of the OCR designationregion is defined so that, for example, the area on which the user wantsto perform character recognition is included. In this manner, it can besaid that the OCR designation region and the erecting designation regionare defined by different criteria.

Moreover, in the specific example shown in FIG. 8A, the region 3Aincluding the characters “8080” is the OCR designation region. Here, theOCR designation region identification section 16 identifies the positionof the region 3A based on the OCR designation information in accordancewith the erecting direction determined by the erecting directiondetermination section 14 (that is, the direction of 0 degrees). Toadditionally describe, the OCR designation region identification section16 does not identify the position of the region 3A from the pluraldirections (for example, four directions) of the target image data 1A asthe erecting designation region identification section 13 does, but mayidentify the position of the region 3A from the erecting directiondetermined by the erecting direction determination section 14.

Then, the OCR execution section 17 executes the OCR process inaccordance with the erecting direction (the direction of 0 degrees), tothereby recognize the characters included in the region 3A. Toadditionally describe, the OCR execution section 17 does not read thecharacters from the four directions as the erecting directiondetermination section 14 does, but may read the characters from theerecting direction determined by the erecting direction determinationsection 14 and check the characters against the predefined dictionarycharacter patterns to perform character recognition. In the specificexample shown in FIG. 8A, the characters “8080” are outputted as therecognition result.

Next, in the specific example shown in FIG. 8B, the characters “Date:Jan. 1, 2015” and “Amount: 8080 yen” are described on a document of thetarget image data 1A. Then, the region 2A including the characters“Date: Jan. 1, 2015” is the erecting designation region. Moreover, theregion 3A including the characters “8080” is the OCR designation region.

Here, the erecting designation region identification section 13identifies the position of the region 2A as the erecting designationregion of the target image data 1A based on the erecting designationinformation. Then, the erecting direction determination section 14recognizes the characters “Date: Jan. 1, 2015” included in the region 2Aby executing the OCR process, to thereby determine the erectingdirection of the target image data 1A. In the specific example shown inFIG. 8B, the direction of 0 degrees (the direction in which a long sidecomposed of apexes a1 and a2 in the target image data 1A faces upward inthe figure) is outputted as the erecting direction of the target imagedata 1A.

Moreover, the OCR designation region identification section 16identifies the position of the region 3A based on the OCR designationinformation in accordance with the erecting direction determined by theerecting direction determination section 14 (that is, the direction of 0degrees). Then, the OCR execution section 17 executes the OCR process inaccordance with the erecting direction (the direction of 0 degrees), tothereby recognize the characters included in the region 3A. In thespecific example shown in FIG. 8B, the characters “8080” are outputtedas the recognition result.

Note that, among the characters “Date: Jan. 1, 2015”, for example,characters of the alphabet, such as “D”, “a”, “t” and the like ornumerical characters, such as “2”, “5” and the like are not correctlyread when being flipped vertically or rotated 90 degrees in the rightdirection or the left direction. In other words, it can be said that thecharacters causing recognition difficulty when the target image data 1Ais rotated from the erecting direction are included in the region 2A,which is the erecting designation region.

Moreover, in FIGS. 8A and 8B, description has been given of the examplesin which the OCR designation region and the erecting designation regionare the different regions; however, it is assumed that, in some cases,as a result of defining each of those regions according to a differentcriterion, the regions coincide with each other.

<Processing Procedures by Image Processing Device>

Next, description will be given of procedures performing the process oferecting direction determination and character recognition by the imageprocessing device 10. FIG. 9 is a flowchart showing an example of theprocedures performing the process of erecting direction determinationand character recognition by the image processing device 10.

First, the erecting designation region identification section 13identifies the position of the erecting designation region from fourdirections of the target image data based on the erecting designationinformation obtained by the erecting designation information obtainingsection 12 (step 101). Next, the erecting designation regionidentification section 13 determines whether or not the identifiederecting designation region extends off the target image data (step102). If the erecting designation region extends off the target imagedata (Yes in step 102), the erecting designation region identificationsection 13 excludes the extending-off erecting designation region fromthe determination target of the erecting direction (step 103).

Subsequent to step 103, or in the case where negative determination ismade in step 102 (No in step 102), the erecting designation regionidentification section 13 determines whether or not the erectingdesignation regions that are left without being excluded overlap eachother (step 104). If the erecting designation regions overlap each other(Yes in step 104), the erecting designation region identificationsection 13 merges the erecting designation regions overlapping eachother (step 105). Here, as the examples shown in FIGS. 5A to 5E andFIGS. 6A and 6B, the conditions for merging the erecting designationregions or how the shape of the erecting designation region aftermerging will be may be set in advance.

Next, the erecting direction determination section 14 executes the OCRprocess on the erecting designation region after merging and theerecting designation region that has not been merged but has been leftwithout being excluded, to thereby recognize the characters included ineach of the erecting designation regions and determine the erectingdirection of the target image data (step 106). Then, the erectingdirection determination section 14 determines whether or not theerecting direction is uniquely determined (step 107). If the erectingdirection is uniquely determined (Yes in step 107), the erectingdirection determination section 14 outputs the determination result ofthe erecting direction (step 108). Here, the outputted determinationresult of the erecting direction may be displayed, for example, on thescreen of the display 105.

On the other hand, if the erecting direction is not uniquely determined(if the erecting direction determination section cannot be determined)(No in step 107), the erecting direction determination section 14determines the erecting direction of the target image data by executingthe OCR process on the entire target image data (step 109). Here, theerecting direction determination section 14 performs characterrecognition by the OCR process based on the image information of theentire target image data, to thereby determine the erecting direction.Next, the erecting direction determination section 14 determines whetheror not the erecting direction is uniquely determined (step 110). If theerecting direction is uniquely determined (Yes in step 110), the processproceeds to step 108. On the other hand, if the erecting direction isnot uniquely determined (No in step 110), the process flow isterminated.

Subsequent to step 108, the OCR designation region identificationsection 16 identifies the position of the OCR designation region inaccordance with the erecting direction of the target image datadetermined by the erecting direction determination section 14 based onthe OCR designation information (step 111). Next, the OCR executionsection 17 recognizes the characters included in the OCR designationregion by executing the OCR process on the OCR designation region inaccordance with the erecting direction of the target image data (step112). Then, the OCR execution section 17 outputs the result of characterrecognition (step 113). The outputted result of character recognition isdisplayed, for example, on the screen of the display 105. Then, theprocess flow is completed.

As described above, in the exemplary embodiment, the erectingdesignation region and the OCR designation region are defined on theimage data of the image formed on the document. Then the erectingdirection determination section 14 determines the erecting direction ofthe image based on the image information of the erecting designationregion. By the erecting direction determination process of the erectingdirection determination section 14 in this manner, for example, ascompared to the case in which a direction of a document is determined byuse of image information of the entire document, a processing load ofthe image processing device 10 required to determine the erectingdirection is reduced, and thereby determination is made at high speed.

Moreover, the OCR designation region identification section 16 or theOCR execution section 17 may perform identification of the OCRdesignation region or character recognition in the OCR designationregion in accordance with the erecting direction determined by theerecting direction determination section 14. Further, to prevent theposition of the erecting designation region from being identifiedincorrectly in accordance with the direction of the document set by auser or the like, the erecting designation region identification section13 identifies the position of the erecting designation region formplural directions of the target image data.

Note that, it is possible to provide a program that implements theexemplary embodiment according to the present invention by acommunication tool, of course, and it is also possible to store thereofin a storage medium, such as a CD-ROM, to be provided.

The foregoing description of the exemplary embodiment of the presentinvention has been provided for the purposes of illustration anddescription. It is not intended to be exhaustive or to limit theinvention to the precise forms disclosed. Obviously, many modificationsand variations will be apparent to practitioners skilled in the art. Theexemplary embodiment was chosen and described in order to best explainthe principles of the invention and its practical applications, therebyenabling others skilled in the art to understand the invention forvarious embodiments and with the various modifications as are suited tothe particular use contemplated. It is intended that the scope of theinvention be defined by the following claims and their equivalents.

What is claimed is:
 1. An image processing device comprising: aprocessor and associated memory configured to: obtain image informationof a second region to detect by way of character recognition of thesecond region an erecting direction of an image formed on a document,the second region being defined in the image in advance for each of aplurality of types of the document according to a criterion differentfrom a criterion for defining a first region in the image, in whichcharacter recognition is performed; and output character information ofthe first region, the character information being recognized inaccordance with the erecting direction of the image obtained from theimage information, wherein an erecting direction of the first region isindeterminable by the character recognition.
 2. The image processingdevice according to claim 1, wherein the processor is further configuredto: obtain positional information to define a position of the secondregion; and determine the erecting direction of the image based on theimage information of each of a plurality of the second regionsidentified in each of a plurality of directions of the image based onthe positional information.
 3. The image processing device according toclaim 2, wherein, as to the plurality of second regions identified inthe respective directions, the processor excludes a second region thatextends off the image, and determines the erecting direction of theimage based on the image information of a second region that is leftwithout being excluded.
 4. The image processing device according toclaim 2, wherein, as to the plurality of second regions identified inthe respective directions, if there are second regions overlapping eachother, the processor merges the overlapping second regions, anddetermines the erecting direction of the image based on imageinformation of a second region after merging.
 5. The image processingdevice according to claim 3, wherein, as to the plurality of secondregions identified in the respective directions, if there are secondregions overlapping each other, the processor merges the overlappingsecond regions, and determines the erecting direction of the image basedon image information of a second region after merging.
 6. The imageprocessing device according to claim 2, wherein, if the erectingdirection of the image cannot be determined based on the imageinformation of the second region, the processor determines the erectingdirection of the image based on image information of the image as awhole.
 7. The image processing device according to claim 3, wherein, ifthe erecting direction of the image cannot be determined based on theimage information of the second region, the processor determines theerecting direction of the image based on image information of the imageas a whole.
 8. The image processing device according to claim 4,wherein, if the erecting direction of the image cannot be determinedbased on the image information of the second region, the processordetermines the erecting direction of the image based on imageinformation of the image as a whole.
 9. The image processing deviceaccording to claim 5, wherein, if the erecting direction of the imagecannot be determined based on the image information of the secondregion, the processor determines the erecting direction of the imagebased on image information of the image as a whole.
 10. The imageprocessing device according to claim 1, wherein the position of thesecond region is defined to include a character that causes recognitiondifficulty when the image is rotated from the erecting direction in thesecond region.
 11. The image processing device according to claim 2,wherein the position of the second region is defined to include acharacter that causes recognition difficulty when the image is rotatedfrom the erecting direction in the second region.
 12. The imageprocessing device according to claim 3, wherein the position of thesecond region is defined to include a character that causes recognitiondifficulty when the image is rotated from the erecting direction in thesecond region.
 13. The image processing device according to claim 4,wherein the position of the second region is defined to include acharacter that causes recognition difficulty when the image is rotatedfrom the erecting direction in the second region.
 14. An image readingapparatus comprising: a scanner that reads an image formed on adocument; and a processor and associated memory configured to: obtainimage information of a second region to detect by way of characterrecognition of the second region an erecting direction of the image readby the scanner, the second region being defined in the image in advancefor each of a plurality of types of the document according to acriterion different from a criterion for defining a first region in theimage, in which character recognition is performed; and output characterinformation of the first region, the character information beingrecognized in accordance with the erecting direction of the imageobtained from the image information, wherein an erecting direction ofthe first region is indeterminable by the character recognition.
 15. Anon-transitory computer readable medium storing a program that causes acomputer to execute functions, the functions comprising: obtaining imageinformation of a second region to detect by way of character recognitionof the second region an erecting direction of an image formed on adocument, the second region being defined in the image in advance foreach of a plurality of types of the document according to a criteriondifferent from a criterion for defining a first region in the image, inwhich character recognition is performed; and outputting characterinformation of the first region, the character information beingrecognized in accordance with the erecting direction of the imageobtained from the image information, wherein an erecting direction ofthe first region is indeterminable by the character recognition.
 16. Theimage processing device according to claim 1, wherein the second regionis separate and distinct from the first region.
 17. The image processingdevice according to claim 1, wherein the second region is outside of thefirst region.